﻿<#macro page pageset link containerId="pageDiv" pageSize=10 maxShowPage=10> 	
<style type="text/css">
#pageDiv{clear:both; display:block; padding:15px 5px 15px 5px; zoom:1; overflow:auto;}
#pageDiv a,#pageDiv a:active,#pageDiv a:link,#pageDiv a:visited{
	padding:2px 4px 2px 4px;
	margin:2px -0.5px 2px -0.5px;
	text-decoration: none;
	border:1px solid #ccc;
	color:#777;
	font-size:11px;
	font-weight:bold;
	font-family:Arial, Helvetica, sans-serif,'宋体','新宋体';
	}
#pageDiv a:hover{
	padding:2px 4px 2px 4px; 
	margin:2px -0.5px 2px -0.5px;
	text-decoration: none;
	border:1px solid #06c;
	color:#06c;
	background:none;}
#pageDiv span.current{
	padding:2px 4px 2px 4px; 
	margin:2px -0.5px 2px -0.5px;
	font-weight: bold;
	border:1px solid #06c;
	color:#fff;
	background:#5197e7;
	font-size:11px;
	font-weight:bold;
	font-family:Arial, Helvetica, sans-serif,'宋体','新宋体';
}
#pageDiv span.extend,#pageDiv span.pages{
	padding:2px 4px 2px 4px; 
	margin:2px -0.5px 2px -0.5px;
	font-weight: bold;
	border:1px solid #555;
	color:#fff;
	background:#9c9c9c;
	font-size:11px;
	font-weight:bold;
	font-family:Arial, Helvetica, sans-serif,'宋体','新宋体';
}
#pageDiv a.current{
	padding:2px 4px 2px 4px; 
	margin:2px -0.5px 2px -0.5px;
	font-weight: bold;
	border:1px solid #06c;
	color:#fff;
	background:#5197e7;
	font-size:11px;
	font-weight:bold;
	font-family:Arial, Helvetica, sans-serif,'宋体','新宋体';
}
</style>
   <div id="${containerId}">
   		<#if pageset.totalPage lt 2>
   			<span class="pages">上一页</span> 
   			<#if pageset.totalPage == 1>
   				<span class="pages">1</span> 
   			</#if>
   			<span class="pages">下一页</span> 
   		<#else>
   			<#if pageset.hasPrev >
   				<a href="${link}(${pageset.pageNo-1},${pageSize});">上一页</a>
   			<#else>
   				<span class="pages">上一页</span> 
   			</#if>
   			<#if pageset.totalPage gt maxShowPage>
   				<#if pageset.pageNo gt 6>
   					<a href="${link}(1,${pageSize});">1</a>
   					<a href="${link}(2,${pageSize});">2</a>
   					<span align="center">...</span>
   				</#if>
   				<#list pageset.startPage .. pageset.endPage as no>
	   				<#if no == pageset.pageNo>
			   			<span class="current">${no}</span>
			   		<#else>
			   			<a href="${link}(${no},${pageSize});">${no}</a>
			   		</#if>
	   			</#list>
	   			<#if pageset.endPage lt pageset.totalPage-1>
	   				<#if pageset.endPage lt pageset.totalPage-2>
	   					<#if pageset.totalPage gt pageset.endPage>
		   					<span align="center">...</span>
		   				</#if>
	   				</#if>
	   				<a href="${link}(${pageset.totalPage-1},${pageSize});">${pageset.totalPage-1}</a> 			
	   				<a href="${link}(${pageset.totalPage},${pageSize});">${pageset.totalPage}</a> 
	   			<#else>
	   				<#if pageset.endPage == pageset.totalPage-1>
	   					<a href="${link}(${pageset.totalPage},${pageSize});">${pageset.totalPage}</a> 
	   				</#if>
   				</#if>
   				
   			<#else>
   				<#list 1 .. pageset.totalPage as no>
   					<#if no == pageset.pageNo>
   					<span class="current">${no}</span>
   					<#else>
   					<a href="${link}(${no},${pageSize});">${no}</a>
   					</#if>
   				</#list>
   			</#if>
   			<#if pageset.hasNext>
   				<a href="${link}(${pageset.pageNo+1},${pageSize});">下一页</a>
   			<#else>
   				<span class="pages">下一页</span>
   			</#if>
   		</#if>
    </div>
</#macro>
